package com.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;

public class FileOutPutStreamDemo01 {

    public static void main(String[] args) throws IOException {
        FileOutputStream fileOutputStream = new FileOutputStream("D:\\dev\\1\\fout.txt",true);
        Scanner scanner = new Scanner(System.in);
        while(true) {
            System.out.println("请输入");
            String msg= scanner.nextLine();
            fileOutputStream.write(msg.getBytes());
            if("886".equals(msg))
                break;
        }
        scanner.close();
        fileOutputStream.close();
    }
}
